package ar.com.angel.beans.sync{

import flash.events.Event;
import mx.collections.ArrayList;
import mx.controls.Alert;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;

    public class Block {

        private var _methods : ArrayList;

        public function Block() {
            _methods = new ArrayList();
        }

        public function register(operation : AbstractOperation) : BlockMethod {
            var method : BlockMethod = new BlockMethod(operation, this);
            _methods.addItem(method);
            return method;
        }

        public function execute() : void {

            for each( var method : BlockMethod in _methods.toArray() ) {
                method.execute();
            }

        }

    }

}